Stream generated JSON.

Now the generated JSON is streamed as each ledger is received, rather than being accumulated and then dumped when all ledgers have been received.