Added memcache support, amortize redis cleanup, minor code cleanups.