Rewrite of graph building for multi-module graphs.