rewrite dumper code
fix tests
Skip modules that are referenced early in the tree to avoid duplicates.