Refactors js into two classes.
Merge pull request #35 from birkin/master

Refactors js into two classes.