The up-scaling of ecosystem functions in a heterogeneous world