Using an algebraic formalism based on matrices in SL(2,R), we explicitly give the Teichmüller spaces of Riemann surfaces of signature (0,4) (X pieces), (1,2) ("Fish" pieces) and (2,0) in trace coordinates. The approach, based upon gluing together two building blocks (Q and Y pieces), is then extended to tree-like pants decomposition for higher signatures (g,n) and limit cases such as surfaces with cusps or cone-like singularities. Given the Teichmüller spaces, we establish a set of generators of their modular groups for signatures (0,4), (1,2) and (2,0) in trace coordinates using transformations acting separately on the building blocks and an algorithm on dividing geodesics. The fact that these generators act particularly nice in trace coordinates gives further motivation to this choice (rather then the one of Fenchel-Nielsen coordinates). This allows us to solve the Riemann moduli problem for X pieces, "Fish" pieces and surfaces of genus 2; i.e. to give the moduli spaces as the fundamental domains for the action of the modular groups on the Teichmüller spaces. In this context, we also give an algorithm deciding whether two Riemann surfaces of signatures (0,4), (1,2) or (2,0) given by points in the Teichmüller space are isometric or not. As a consequence, we show the following two results concerning simple closed geodesics: On any purely hyperbolic Riemann surface (containing neither cusps nor cone-like singularities), the longest of two simple closed geodesics that intersect one another n times is of length at least ln, a sharp constant independent of the surface. We explicitly give ln for n = 1,2,3 and study its behaviour when n goes to infinity. X pieces are spectrally rigid with respect to the length spectrum of simple closed geodesics.