Improve package removal

This is a "snowball" branch... I found one problem, that led to another, and ended up modifying quite a bit. I wrote comments for each commit below.

You could stop at commit 1, 3, or 4 if you think some of these commits go too far.