Trying to create a better, more modular JavaScript component to this thing.
Fixed a typo.
Various fixes to betterjs branch.
Merge pull request #1 from Ateoto/betterjs

Merging some Javascript changes