Configurational Forces in Dynamics and Electrodynamics