Fixes Package::getDependentPackages()

Also optimizes Package:: getRequiredPackages()