Basic login view.
Major refactoring to sort out scoping issues.