Fix shrink and prune, refactor utils

shrinkwrap and prune had problems with symlinked components