Consolodate header LaTeX into its own file

This commit does some bookkeeping and cleans up the input, usepakage
etc commands.