Fix #5: Web Workers.

Based on patch by @matejk.