ENH: Add tranparent compression to json reading/writing
This works in the same way as the argument to ``read_csv``and ``to_csv``.

I've added tests confirming that it works with both file paths, and S3 URLs. (obviously there will be edge cases I've missed - please let me know if there are important ones that I should add coverage for).

The implementation is mostly plumbing, using the logic that was in place for the same functionality in `read_csv`.

- [x] closes #15644
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
