Change logic of ordering the replacement of cations in formulas to start with the shortest abbreviations first