IE9 compatability

I don't know about other versions, but my version of IE9 doesn't support string characters using array indices.

Replaced "text[...]" with "text.charAt(...)" which fixed the issue for me.
Merge pull request #86 from geraintluff/master

IE9 doesn't support addressing characters as array indices