Ricci Curvature, Optimal Transport and Functional Inequalities