Bug to login

This has several changes required to move forward, and passes what we need it to. Move to merge as it also resolved #10 .