Updated login and registration.

Now returns useful errors and refills the inputs in the form to make
life easier for users.