Optimal transport approximation of measures via lower-dimensional structures : principal manifolds and the average distance problem