Hubble Space Telescope Observations of Globular Clusters in M31.I.Color- Magnitude Diagrams, Horizontal Branch Metallicity Dependence, and the Distance to M31