Add users model

Separate some of the functionality from the routes to the users model