Add a character-based JavaScript implementation.
Merge pull request #4 from kitcambridge/master

Add a character-based implementation