[AddressBook] Extracted contacts db logic from main worker script

This patch basically extracts the previous `getContactsDatabase` and `storeContact` functions from the worker script and move their logic in a new `CollectedContacts` object constructor living in `addressbook/collected.js`.