Ensure content is utf8 encoded before trying to cache and throw an exception if
the json encoding/decoding fails
Retabbing
Merge pull request #76 from FelixOnline/cache_fixes

Cache fixes