Ground-based calibration and characterization of the Fermi gamma-ray burst monitor detectors