NH3 trapped in nitrogen and rare gas matrices. II. High-resolution spectroscopy of ν2 and calculation of the inversion-translation doubling and proper rotation quadrupling