Create separate build steps for amd and commonjs, and separate directories.