Refactor JSONRenderer slightly for easier overriding

Currently the `render` method is just about tending towards the "too large" side, making overriding slightly awkward.  This factors out the `get_indent` behaviour into a separate method, ensuring that an overrides of the base `render` method can be achieved with less code.