Added a user factory implementation to allow overriding the user class.
Added basic implementation of user authentication. Perms impl to come.