User model core code

Core code for user signin/signup/signout. Can be made a bit better. We'll leave that until we can test it and after we implement the views.