The evolution of enzyme functions in the metallo-β-lactamase superfamily