apply label and prettyPrint to JSON output if applicable

Hello, couple of simple changes
* `label` wasn't being included in JSON output. perhaps it should be? Seems to make sense to me.
* if `prettyPrint` is set to `true`, pretty print the JSON output.

All test pass.