JSON serialization now supports dictionaries and arrays

- The JSON serialization was only allowing dictionaries to be passed in
- The JSON specification allows for both, and the underlying
  serializer NSJSONSerialization also supported both
Merge pull request #1880 from darend/json-serialization-arrays

JSON serialization now supports dictionaries and arrays