Move authentication code into a separate module
Move stuff related to authentication from Cookies to Authenticate
Get rid off HTTP dependency