Make refactory-rename more flexible.

Other random fixes.