Characterization of early transition metal carbides and nitrides by NEXAFS