support for browserify

I'm using browserify to package frontend dependencies, but webworker-threads is not compatible with browserify. So I moved require() call to only be executed is there is no Worker object already.