Usermanagement

@rcrichton  Please have a look at what I have done here with user management, I have added the requested tests as well.