Use the compiler front-end for automatic dependencies generation
Fix typo
Conditionally enable tests using gpg
Conditionally enable tests using texmf
Sanitise test environment in a portable way

Closes #153