Evolution of cellular differentiation