Text this: Simulation Algorithm That Conserves Energy and Momentum for Molecular Dynamics of Systems Driven by Switching Potentials