Shadow energy functionals and potentials in Born-Oppenheimer molecular dynamics.