Feature/json exporter

A quick first pass at a JSON exporter. Would welcome some feedback around which fields are required, useful, etc.

For #5343

Note that this hasn't touched the XML export functionality at all.
Could we somehow get a "export_version" key to the root level of the json? Just call it 1.0 for now, we can increment it semantically and when we have a proper json-schema written for this, link to that. But for now I think just the key and 1.0 is good enough.

But it needs IMHO to be on the root level, not inside the user object, so something like (for example):

    {"export_version": "1.0",
     "user": { .... },
    }