Algebraic and analytical tools for the study of the period function