Writing rename_hyps in the new monad.

This new implementation now allows for simultaneous replacing of hypotheses,
thus fixing bug #2149.
Test for bug #2149.