Make dump_profile_data much less likely to OOM
Make dump_profile_data much less likely to OOM

This alters the to-json logic so that, instead of building one massive list of
string bits and writing it all in one go, it flushes chunks of 12KB or so to
disk at a time. This makes it possible to --profile-compile the core setting in
about 10GB of RAM rather than 40+.

I've also added a feature where specifying a --profile-filename ending in .json
causes it to write as plain JSON instead of using the HTML wrapper. This is a
tiny bit faster, and may be useful if you want to poke at it with different
tools. The aforementioned --profile-compile generates *hundreds* of megabytes of
JSON; you're never going to get that to load in a browser.

cygx/nqp,cygx/nqp,cygx/nqp,cygx/nqp,cygx/nqp,cygx/nqp,cygx/nqp,cygx/nqp