Uses amdefine to support browsers and node.