Spectroscopic accuracy directly from quantum chemistry: application to ground and excited states of beryllium dimer.