Login tests

I've completed a working login implementation, and corrected all the existing tests so they work.  I have to check whether more tests, but I don't think so, and have run beyond time for the day.

I messed up the workflow.  I seem to have accidentally committed the login-implementation fixes I made to the master branch.  I know what I did wrong there, and think I'm doing this one right.