Interstellar chemistry of nitrogen hydrides in dark clouds