function amdTransformer(moduleAbsPath, source) {
    // If this source file is not doing funky stuff like overriding require
    if (!/require\s*=/.exec(source)) {
        source = source.replace(/require\s*\((["'])(.+)["']\)/g, function(all, q, mod) {
            var newMod = mod;
            if (mod.indexOf("zed/") === 0) {
                newMod = "configfs!/api/" + mod;
            } else if (mod.indexOf(".") === 0) {
                newMod = "configfs!" + absPath(moduleAbsPath, mod);
            } else {
                return all;
            }
            return "require(" + q + newMod + (/\.js$/.exec(newMod) ? "" : ".js") + q + ")";
        });
    }
    // If no AMD wrapper is there yet, add it
    if (source.indexOf("define(function(") === -1) {
        source = "define(function(require, exports, module) {" + source + "\n});";
    }
    return source;
}
This rewrites extension code in two minor ways:
- requires are rewritten to all point to configfs!
- AMD wrappers are added if they're not already there'