'fixed' cleanup script (now completes)

re-ordered the deletion of resources somewhat which resulted in only a few different errors instead of several more.

added catches for those errors and fixed the cleanup script to keep trying. there is the possibility of an infinite loop here if resources in fact cannot be deleted because of a dependency error however this has never been the case with this cleanup script and the scenarios currently available to my knowledge.