[MJ-259] route login errors back to homepage

Shows login errors on homepage. Also refactored the account creation javascript a little.

All tests pass.