Calculus, heat flow and curvature-dimension bounds in metric measure spaces