Add some debugging output
Refactor purging code for better reusability
Add command-line interface for purge-deleted