Added basic login unit tests

Refactored architecture with factories for mocking and unit test
structure.  There are now login unit tests.