Added an in-memory database
Added switch to use inMemory database instead of redis.