Refactor Redis cacheCheck into lib/cache-middleware.js, add support for ...

...Memcached, update .travis.yml and tests.