Break out the logic that maps file names to modules into files_to_modules().