Stream valid JSON.

Changed code so the final entry in the result array doesn't conclude
with a comma.