Insights into the functional divergence of the haloacid dehalogenase superfamily from phosphomonoesterase to inorganic pyrophosphatase.