Quantum integrability and quantum chaos in the micromaser