Systematic ab initio gradient calculation of molecular geometries, force constants, and dipole moment derivatives