Improve package caching inside DirectoryPackageRepository, adapt tests