Changed caching setup to use before_request and after_request. Working on
finalizing tests for cache.