Move remaining common test utility functions to top-level arborescence
It's shared amongst both package and core loaders.
I intend to migrate the other dvcs loaders with the following change.
It's just code moving to a common arborescence tree.
Related to T2481
Test Plan
tox
Migrated from D3433 (view on Phabricator)