Add error handling to TaskProcessor

If a TaskProcessor threw an error in the Worker, the promise would never resolve.  Instead, if an error occurs in the worker, reject the promise.  This applies to both errors thrown while the worker code runs, as well as DataCloneErrors that may occur if the worker tries to post a message that can't be cloned, or transfer a non-transferable object, etc.

Also add tests for TaskProcessor, and add a helper function to that adapts promises to the Jasmine "waitsFor" style, and also lets you make further assertions on the resolved result or rejected error.