Flattens the namespace of a class/module declaration by replacing its outer modules with a qualified constant name.

Note that removing modules as namespaces alters the nesting within, and changes how constant lookup works.