Refactor header.tex into a package