Reimplement java.lang.String with JS Strings.

You could also use the "flags" parameter to String.replace, although it's a "non-standard Mozilla extension":

```
  return this.str.replace(String.fromCharCode(oldChar), String.fromCharCode(newChar), "g");
```