Oh dear jesus please let login work.  Also, gutted some old code in the files we're still actually using.