Fix and optimize AJAX caching

Fixes the encoding of the response content for cached ajax data.
Seeds the cache with content suitable for the response object, avoiding unnecessary intermediate object creation.
Merge pull request #13 from walmartlabs/ajax-cache

Fix and optimize AJAX caching