The spectra and dynamics of diatomic molecules