Moved some code around; added a configuration option to specify the User class