Cleaned up imports and added an optional database for redis.