Tony Martin won stage 9 of the Tour de France with a stunning solo ride but Frenchman Tony Gallopan has taken the yellow jersey.