The Middle Income Trap: A Way Out Based on Technological and Structural Change