which belief system was the basis for the civil service exams during the Han, Tang, and Song Dynasties? explain