Preserving class definition order in module parsing