Added user authentication, and a bunch of other stuff