Support IE8 and Rhino

I'd like to use your jsonpointer.js module on IE8 and Rhino (javascript implementation in java).
But it is used unsupported method or variable currently.

* IE8 does not support Array.isArray and Array.forEach.
* Rhino(version 1.7) does not support Array.isArray and 'global' variable.
Please move `pair` declaration to other variables' declarations, in between `var escapeSequence;` and `var replaceRegExp;`.
`i` declared inside `for` statement is fine.