Implementation of account_manager.

Implementation of account_manager. The corresponding unit tests also needed some style updates and additional exception handling logic. This fixes #10.