Create a web worker from a function