G4CMP: Condensed matter physics simulation using the Geant4 toolkit