Distances Within And Between Metric Spaces: Metric Geometry, Optimal Transport And Applications To Data Analysis