Rewrite error and monitor event callback API
Add an example that demonstrates custom error callbacks
Update examples
Merge pull request #136 from bjz/callbacks

Rewrite error and monitor event callback API