An Integrable Model for the Dynamics of Planetary Mean-motion Resonances