JDK6 runtime support for json

Warning: the backported try-with-resources are not pretty
Need to check rethrow to avoid unnecessary wrapping: `Exception`
(I leave this as a reminder, I will merge as is and then will return to these lines)