[server] Convert JSON fetch to stream data
Currently the code builds up all the data in a massive blob then tries to encode the JSON. This hits a memory limit on our server for popular products.
By fetching and printing one piece of information at a time we should avoid this. Fetching scalar and non-scalar information now needed to be put together so we fetch non-scalar information on a per-row basis.
Technically more queries, but it saves hash look ups our side.
Tested against the submittest unit test. I haven't tested with "real" data.
BUG: 422227