Shaping developing tissues by apoptosis