Web Workers support
fix global object.
check window.document
Merge pull request #6 from ukyo/webworkers-support

Web Workers support