Refactored login code, storing user data in session, better errors

Put login in a waterfall, now storing user information upon login (see #8), better error handling.
No, for security purposes you don't want to leak the root cause of the login failure.