Refactored C API
Implemented on_interval/on_tick

and refactored some common C code into macros
Started to refactor API

Implemented generic event emitter interface(as a mixin module)/implementation so
ruby code can create arbitrary event emitters. Will refactor the entire API to
match the event emitter pattern