Relatively hyperbolic groups: Intrinsic geometry, algebraic properties, and algorithmic problems