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

also change toJson function to accomodate passing in of number of spaces
I agree that the previous implementation was wrong, but I don't see how we can retain backward compatibility without `parseInt` (or a check for whether `pretty` is a number).

Unless we don't care retaining backward compatibility.