Updated user factory to use DatabaseUser model.
Updated to check whether the encrypted password was changed, instead of relying on previous_values.
Removed login scope, since the database_user is the default anyway (and the user scope is now invalid).