Consolidate ThirdPartyUtil patches

Our ThirdPartyUtil.* changes are spread among various patches. It would be nice to move all those changes to a single patch to help with refactoring and upstreaming to Mozilla.

Patches include: