Generalized orbital angular momentum and the n-fold degenerate quantum-mechanical oscillator: Part I. The twofold degenerate oscillator