User authentication

User authentication back end is working.
Ready to be pulled, pending code review.
N.B. Login and sign out buttons are part of the login-signout branch rather than the user-authentication branch.