Added support of AMD, node.js environments