Refactor code

* Message.encodeEvent
* Worker.postMessage
* Integration tests for worker and iframe
* Rename MessageChannel.postMessage to Window.postMessage