optimized the JSON pretty printer (with premature optimizations),
couldn't get preg_replace() or ltrim() working to strip leading spaces