Standardize callback and cleanup code.
Fix callback and events to work as define in cylon.
Emit correct event when an error occurs in the adaptor.
Merge pull request #4 from hybridgroup/standardize-callback

Standardize callback and cleanup code.