Fix a bunch of doctests with the -d option of refactor.py.
We still have 27 failing tests (down from 39).
24 files changed