Mark Cavendish was happy to pay back his Omega Pharma-Quickstep team-mates by winning a chaotic stage 13 of the Tour de France.