Add memcache

* restructure some code to be more generic
* duplicate data tests for mc
* add primary key concept for single key lookup