Refactors a bunch of code so that it decomposes nicely into PackageInfo-style packages. Also adds discard* methods to SystemDictionary to make it easy to remove those packages from the image.