We present an algebraic method to study four-dimensional toric varieties by lifting matrix equations from the special linear group ${rm SL}_2({mathbb Z})$ to its preimage in the universal cover of ${rm SL}_2({mathbb R})$. With this method we recover the classification of two-dimensional toric fans, and obtain a description of their semitoric analogue. As an application to symplectic geometry of Hamiltonian systems, we give a concise proof of the connectivity of the moduli space of toric integrable systems in dimension four, recovering a known result, and extend it to the case of semitoric integrable systems with a fixed number of focus-focus points and which are in the same twisting index class. In particular, we show that any semitoric system with precisely one focus-focus singular point can be continuously deformed into a system in the same isomorphism class as the Jaynes-Cummings model from optics.