properly encapsulate overlay hack and properly dispose overlays

The code used to wash diffs has two major issues which together are very likely responsible for most of the performance issues Magit has.

This Pr fixes the first of these issue, overlays are not properly disposed of and that causes diffs to get slower and slower. See 84af6d682fae9c2640f0fb4701900d2eb97c81fd.

The other commits make improvements to code related to the things touched by the above commit. They don't actually contribute to the performance improvement. The last commit actually is about *log* not *diff* and actually *decreases* performance. But I expect the effect to minimal; having up to a few dozen overlays in a buffer should not be noticeable. What *is* noticeable are *hundreds* of overlays accumulating over time.

For the second performance issue I will open a new ticket. I will get to fixing that tomorrow, but don't know yet whether I will do so against `master` or `next`.