Molecular reorganization upon ionization and excitation: NH2, NH2+, and NH2− systems