MemcacheCloud support with a little bit of refactoring

This supersedes #16 with the changes I commented to @peterfarrell about.