Passes the error message and result to event handlers

Fixes #170

You can't simply pass the error object because it's not enumerable, so it will always be empty when sent into JSON.stringify(). The message works well enough for our use case.