cleaned up code

applied some JSLint suggestions and renamed eventDelegate to
eventHandler