Properly storing and executing the 'onmessage' function within WebWorker.