Agile Maneuvers in Legged Robots: a Predictive Control Approach