Adding experimental require() function like commonjs (barebones support for require() and exports)
src/main/javascript/events/events.js

tidy up variable names
tidy up variable names