Large re-organization to remove cyclic module dependency graph #381