More work to LoginHandler

Most of the code is ending up here. Might want to merge this and the
main class