https://github.com/oyvindkinsey/easyXDM but built for npm and CommonJS