The diachronic reordering of phonological rules