Support pluggable metric caching.

Current caching to JSON serialized file is supported by default (and will work with present configuration files not specifying a driver). A PECL libmemcached driver is also included. Both have been tested in production and appear to work.