Error handling updates
We've improved handling of errors by passing the great error messages from the API back to the calling program, which we hope will help developers debug their rules more quickly. We've also cleaned up handling of the script's calling environment and improved debugging output.