Add formatting option to `std.json.toJSON`.

This allows JSON to be used as a temporary serialization format when debugging an application as it becomes human- and diff-readable.

Empty JSON object/array is formatted as "{}"/"[]".
Merge pull request #1263 from denis-sh/std.json-improvements-3

Add formatting option to `std.json.toJSON`.