major refactor of the javascript now uses a simple dom library with the functions dom.parse and dom.query as well as an on method