Added namespacing and started documentation of JS.  Changing code to use js library best practices.