Added events.js, implemented (untested) on and trigger