(proof-new) Miscellaneous changes to strings for proofs (#5362)
This includes all minor remaining changes from proof-new for strings that were not merged to master.
This includes mostly minor changes to make proofs pass, including reordering assertions. It also removes some non-standard pedantic checks as these are now subsumed by standard ones.
It also makes the strings rewriter slightly more safe when checking arithmetic entailment under assumptions. This code used substitution, which was not safe when quantifiers were involved. This is replaced by capture avoiding substitution here.