Add Redis caching support

Adds support for using Redis as the caching layer. (Redis is similar to memcache with optional persistence and some extra data structure support. Not that the extra stuff is really used here, but it's convenient if Redis is already in use on the server.)

Compatible with the phpredis extension:
https://github.com/nicolasff/phpredis