Divergence, recombination and retention of functionality during protein evolution