Add javascript implementation
Merge pull request #5 from ahultgren/master

Javascript implementation