Add support for JSON.stringify to ComponentData

I suppose this is a sort of regression corner-case. The workaround seems to be to add a `JSON.stringify`-friendly `toJSON` method to `ComponentData` that serializes its view of itself. See #1548

Is this the correct solution?
I think the iteration below is sufficient, don't need to iterate `._data` or `._mappings` as getter/setters get added for these that will get picked up by `k in this`