Completed user login and lout feature

Abstracted all the user management features into a service.