switch to a module pattern
leaked global
leftover console.log
fixed refrence to global to new module
syntax errors
Merge pull request #87 from shidel-dev/js_refactor

Js refactor