Move newtype-unwrapping to the rewriter
This is an attempt to solve #22519 (closed) by doing newtype-unwrapping in the rewriter. Sadly, I can't remove it from the canonicalizer, as explained in Note [Unwrap newtypes first].
TODO: Commit message.
@simonpj, this is ready for review.