Pretty print json and xml in debug mode

For json, use the built in JSON_PRETTY_PRINT constant, if available
(PHP 5.4.0 or later)