Added preliminary JSON output support.