Electronic states and mechanical properties in transition metal nitrides