Added options for choosing leveldb or redis.