Various improvements to the JSON code and test reporting bits