Pass Redis into class instances, general tidying

Since most instance methods in both the User and URL classes talk
to Redis, I decided to pass the Redis object in when instantiating
those objects.

Additionally, there's some minor code shuffling and tidying with
no futher functional changes.