Primitive event tracking, jshint fixups