Callbacks are now called respectively.
Added an event handler.
Fixed a few issues with logging
send_raw now gets logged
minor optimizations