The electronic structure of NbC and NbN