Use NamespacedClassVisitor to flatten classes.