Update event listeners and unroll tick

Event listeners moved to use modern event handling.
Unrolled the tick loop to try to speed things up a little.