Manifest pruning

See commit messages for explanation