WIP - Worker initialisation random failures fixes

This branch is intended to fix the initialisation issues around the worker taking longer than sidebars to initialise.

The basic ideas here are:

a) Create a new worker object, to be used in future as the main object in the worker
b) fix issues around the async database loading
c) make the sidebar wait until the worker has finished loading before starting any sign-in items.

This is WIP and not yet intended for merging. Some of it may get split out to separate PRs if it gets too big.