Use blocks when opening files
Make running bibtex a function

Also, unify the args for run_* to just what is needed (the job name).
Minimise LaTeX runs

Rather than using some crazy dependency tree of .pdf and .bbl and .aux
files, run_latex just calls run_bibtex, and rebuilds as necessary
(specifically: if bibtex needs to be run, or if LaTeX itself warns that
the file has changed).

This means that a change in the tex file (when a bibliography is
present) doesn't always cause two runs of LaTeX (one draft, one final).