The strongest earthquake to hit the Philippines in 50 years has left a trail of destruction, killing at least 37 people and displacing more than 32,000.