  This is an extended (factor 2.5) version of arXiv:math/0601371 and arXiv:0808.3486. We present new results in the theory of the classical $\theta$-functions of Jacobi: series expansions and defining ordinary differential equations (\odes). The proposed dynamical systems turn out to be Hamiltonian and define fundamental differential properties of theta-functions; they also yield an exponential quadratic extension of the canonical $\theta$-series. An integrability condition of these \odes\ explains appearance of the modular $\vartheta$-constants and differential properties thereof. General solutions to all the \odes\ are given. For completeness, we also solve the Weierstrassian elliptic modular inversion problem and consider its consequences. As a nontrivial application, we apply proposed techni\-que to the Hitchin case of the sixth Painlev\'e equation. 
Non-canonical extension of theta-functions and modular integrability of   theta-constants