Made it a class method that is run in a subprocess, for when checking in the main buildstream process. Part of #802