Support customizing redis database number

Since I run a couple of services using Redis, I needed to specify different database numbers to prevent them from clashing. This patch makes the database number customizable.