This is what is used almost everywhere in the API, so converting the test facilities removes the need for a lot of std::make_shared<Proof>().
Note that buildRandomProofRef would be a better name after D10342, so I didn't rename the function in this diff.
Ref T1854.