adding AMD/node.js support