Properly serialize arrays to json or a hash

Both #to_json and #serialize are implemented along with some important
fixes and refinements:

* Expose an `expanded_cache_key` method within the caching module.
* Disable caching on objects within the array to prevent duplicate
  caching.
* Key objects based on the expanded cache key to ensure a match between
  individual object and array object caching.