Two-mode generalization of the Jaynes-Cummings and Anti-Jaynes-Cummings models