extracted fix_component_names into its own file with a test

dumb refactor, but I accidentally started doing it anyway, so I finished.