Superintegrability on Three-Dimensional Riemannian and Relativistic Spaces of Constant Curvature