Working memcache

Cleared the code and got memcache working.