Added more emitter specs
Refactored some code to ruby
Refactored some macros
Refactored timer emitter