Store session in database

- Use https://github.com/amalloy/mongo-session library for storing the
session in mongodb
- Add some minor changes