A massive explosion guts Mexico's biggest fireworks market, killing at least 31 people and injuring 72, the authorities say.