some fixes to the formatter and it now also can process raw input into json

see the commit chain; when you feed it raw data (object tree or array...) as input PHP 5.4 default json pretty printing can be used when available; otherwise you get the same result using the custom code, which has been fixed to always use the same amount of whitespace irrespective of the exact amount available in the input (string or raw).