Orbifold compactness for spaces of Riemannian metrics and applications