Refactored cleanup method for removing resources based on dependencies to work with either sub item archives or render pass archives for ease of use.