Density functional and multireference ab initio study of the ground and excited states of Ru2