This is my hacked version of ender postMessage from: https://github.com/thomassturm/ender-postmessage
The only changes are the names of the methods and I declare the amd/requirejs export...
To use this:
message = require('message')
message.post ...
message.receive ...