"Simplify Pkg2.resolve" Take 2

This reverts commit cc790227cf2bef780dc937d49da0ef9c1fc20578.
Fix a problem when removing packages
Merge pull request #3700 from JuliaLang/kf/pkg2

"Simplify Pkg2.resolve" Take 2