Fixed up a lot of the middleware, including the body parser and csrf.
Added mongodb session storage.