fixed some coffescript syntax on event class and write tests for javascript