Added PackageTreeBuilder and its tests