AccountManager: Refactor authentication and account management code
Refactor the authentication and account management code into an AccountManager
component in the core. At the moment the logic's spread across various parts of the UI.
It might be nice, for example, if we had a single method that would return an enum for the account state (no account, creating account, signing in, signed in, signing out, signed out), which we could then extend with new states (locked, unlocking).
Sub-ticket of #1247 (closed)