Adds basic javascript structure. Adds basic events dispatching