webworker can now call global functions from main, wait until main replies with the result, and then continue execution.