Working session handling, login and register.

Other minor improvements.
Moving compojure middlewares to util.clj