adds test for refactored function.
adds login infrastructure (not yet complete).
Merge pull request #32 from birkin/master

adds initial login infrastructure (not yet complete).