Some miscellaneous rewrite rules.
We should organize these into more clear categories, as done for most of the other rules.