Check for existence of the Redis extension

* Also made some minor code style tweaks

Change-Id: I5dbdf129bf3e5e6a4d54dc75829aede5efc816e1