Apply worker changes to main.js.
Merge pull request #13 from matthewruttley/main-fix

Apply worker changes to main.js.