Use String.charAt for character by index lookup

Using object property accessor for string character lookup breaks in
non-modern browsers.
Merge pull request #2651 from arnihermann/use-charat-not-string-index-markup-diff

Use String.charAt to lookup string characters by index