Evolution of an ancient protein function involved in organized multicellularity in animals