Improve MD2D .addKEToAtoms() function, make it more generic

Now it can add KE to any group of atoms, not only 2 or 3 atoms.
Implement .setValenceElectrons() function (available in Scripting API)

[#61307388]