Electronic Structure and Molecular Dynamics Simulations for Alkaline Earth and Alkali Metals