Added functions to Users Model, began refactoring loggedin to use new structure