Add more error handling to catch and report errors in event handlers, but allow task to continue; fix bug with randomInteger sometimes producing max value; add checks to make sure all required params are passed to event handlers