feat(jsonFilter): add optional arg to define custom indentation

also change toJson function to accomodate passing in of number of spaces

Closes #9771
test(toJson): add extra test cases for new `pretty` behaviour
refactor(toJson): remove breaking change from previous CL

Closes #10297