JDK6 runtime support for json

Warning: the backported try-with-resources are not pretty
I will miss that `switch` (Performance?). Ideally I would like to have something like https://github.com/mozilla/rhino/blob/master/toolsrc/org/mozilla/javascript/tools/idswitch/SwitchGenerator.java. I mean it should produce similar output, but more effectively coded.

(I leave this as a reminder, I will merge as is and then will return to these lines)