Login form, more refactoring. Closes #5