A characteristic mapping method with source terms: Applications to ideal magnetohydrodynamics | Synapse