fix tests

- pretty and indent work now
- strip trailing newline for generated JSON compat output