Upgrade efficiency and correctness improvements.

1. Only upgrade a package's dependents if the package was actually rebuilt.

2. If a package was rebuilt, force all of its dependents to be rebuilt.