Normalize names in inputs and outputs, rename variables in matches and expressions.