Moved the session in-memory database to a new file and made sessions more async (in preparation for support for databases like Mongo)