Delete snapshots

This adds the ability to retire old snapshots (i.e delete them).

Also refactors some of the existing code.