Added implementation of account_manager.

Follow up to rejection of #14. This adds some unit test fixes with regards to time-dependent testing and asynchronous error handling.