A middleware style wrapper around window.postMessage to do inter window DOM messaging