Route bugfix, jQuery optimisations and allows enter button for login

Made a branch for these separately as the other pull request growed quite large on my master.