* Clean up JavaScript making sure we have all the
  machinery in closures
* Add documentation