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
You don't want to do this parent check on the first tier but only on the subsequent ones. That's why the tests are failing. The subtree roots' parents aren't in `to_be_deleted` so nothing gets deleted.