Uses most of the machinery we have built up by now to implement this, so
hopefully it should be an easy comparison.
Also, extends the `monkeyPatchedBuiltin` with an additional way to patch
built-ins (because this was needed to get a test to pass).
No test changes.