Wait for scripts defined in common xmodule code to execute.

STUD-1792

@cpennington @andy-armstrong What do you think of this approach? I can't reproduce the bug locally to confirm that it fixes it... When I run locally, the Promise is resolved before the JS in container.html and unit.html executes.

@singingwolfboy Adding you in case you are interested or know of a better way to dynamically add JS dependencies. Ideally, we'd like to say that "xmodule" depends on all these individual scripts being loaded and executed.
Also, I probably wouldn't capitalize ```XModulePromise``` because it isn't a class. I'd go with ```xmodulePromise``` or maybe something like ```xmoduleInitializing``` or ```xmoduleLoading```. It conceptually represents the operation of loading the module dependencies, and IMO it would be easier to read as:

    xmoduleLoading.done(function() {
        ...
    });