Moved much of the auth/login logic into HuxleyUser static methods, and added unit tests for them. Also took the first steps in only supporting browsers with javascript enabled (by returning only JSON for POST requests.
Minor changes to accounts/views.