Periods of Abelian Integrals, Theta Functions, and Differential Equations of KdV Type