Refactored the login view and controller. Added some event handling for
login processes.