Computational methods for first-principles molecular dynamics with linear-scaling density functional theory