Created a new updateThreads function which will replace the updateEmails function — it fetches the threads from Gmail/Outlook and converts them into the correct data structure for storage straight into IndexedDB