Efficient periodic density functional theory calculations of charged molecules and surfaces using Coulomb kernel truncation