Switch InstallPlan over to using IPID-indexed PackageIndex

So, uh, this kind of depends on #2051 (so the commit shows up multiple times). There is also a minor warning-squashing commit which you can either take or ignore.