Add memcache caching support, small tweaks