JSON.sh uses bashisms

Such as ==, let and [[. This reduces compatibility with (for example) bourne shell and dash.

(I'm working on a small PR, but am not sure if you actually want to cater for the case where someone wants to source the script instead of run it - clearly it's used in the tests, but if I tweak those to work differently are you still interested in being able to source it?)