fix string/replace spec on IE7 and rename 3rd argument to replacements

spec was failing on IE7 because strings chars can't be accessed with `[0]`
notation. Also renamed 3rd argument to `replacements` to make it different from
the function name (jshint stops complaining and easier to understand).