Solvent variation inverts substrate specificity of an enzyme