China has agreed to end a massive and complex programme of export subsidies on a range of products including textiles, apparel and footwear.