Pass worker as first argument to module.exports

This makes it easier to write a function which falls back to the main thread if webworkers aren't available.