Moving event.js to a module