only recusively delete modules if all their parents are marked for delet...

...ion (PLAT-333)

@dmitchell , may you please take a first look? I changed the tests a bit, and and added a management command. But otherwise the change is quite small
Without `commit` should it act like a dry run and return the list of would be deleted items? `get_orphans` in other words