function loadExtension(name, config, entryPoint) {
        var result = new $.Deferred(),
            extensionRequire = brackets.libRequire.config({
                context: name,
                baseUrl: config.baseUrl,
                /* FIXME (issue #1087): can we pass this from the global require context instead of hardcoding twice? */
                paths: {
                    "text" : "../../../thirdparty/text",
                    "i18n" : "../../../thirdparty/i18n"
                },
                locale: window.localStorage.getItem("locale") || brackets.app.language
            });
        contexts[name] = extensionRequire;

        console.log("[Extension] starting to load " + config.baseUrl);
        
        extensionRequire([entryPoint], function () {
            console.log("[Extension] finished loading " + config.baseUrl);
            result.resolve();
        });
        
        return result.promise();
    }
Loads the extension that lives at baseUrl into its own Require.js context

@param {!string} name, used to identify the extension
@param {!string} baseUrl, URL path relative to index.html, where the main JS file can be found
@param {!string} entryPoint, name of the main js file to load
@return {!$.Promise} A promise object that is resolved when the extension is loaded.