implemented Async Javascript Execution
moved  from begin/end to task pattern
added cleanup code if the proxy to the subprocess throws exception