My JSON code is new, so there were a couple of problems.
1. I wasn't properly encoding double-quotes.
2. If a list had scalars it wasn't outputting them correctly.
Here's an example of a JSON query that caught both errors.
I've run it through JSONLint, and it says it's valid.
Thanks to Eric Kidd for both reports, perfectly documented.