Enzyme functional evolution through improved catalysis of ancestrally nonpreferred substrates