Integral geometry and the Gauss-Bonnet theorem in constant curvature spaces