Initial implementation of caching

This commit adds caching capability to weiyu. Initially, redis (with
redis-py) and memcached (with python-memcached) are supported.
Merge branch 'cache-subsystem'