What major economic developments took place during the dynasties of the Tang (618–907) and Song (960–1279)?