Law and development of middle-income countries : avoiding the middle-income trap