Add ability to return errors from callbacks, fixes #2

This is done by setting the Err field at the event sent to the callback.