Added modularity for AMD/node.js