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.)

Requires the phpredis extension if redis is chosen as the cache:
https://github.com/nicolasff/phpredis