Closure-Module-Dependency is a project mainly written in JAVASCRIPT and RUBY, it's free.
Example of advanced closure module dependency management
This simple example shows how to load goog.ui.CustomButton dynamically inside another module. It's little more complicated than loading file without dependencies or with dependencies, but that have already been loaded. The difference is that in modules_info file all the dependencies has to be added that hasn't been loaded yet.
In general I used calcdeps.py to calculate dependencies for app.js (and app_init.js) and detect what dependencies hasn't been loaded that will be required for loaded_module.js.
Have experimented a little bit with css and added loaded_module_css.js file that is loaded as well with loaded_module. It actually adds all css goog.ui.CustomButton needs dynamically without having to load css files.