Add pruning of preimages no longer needed + tests