The evolution of collective infectious units in viruses