Fixed concurrency problems in login

Fixed concurrency problems in login,

Plus all tests passing.

Next step: Begin Task module