Login and Cleanup of Gaps

The controller has been cleaned up to better control validation and
usability. The login and logouts have also been tweaked.