What major changes in political structures, and social and economic life, occurred during each of the following dynasties: Sui, Tang, and Song?