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.
I'd rather not do that, it would make any database problem show up as "Invalid credentials" to the user, wouldn't it?