Use aliases for unit test dependencies.

Still not great, but an improvement.
Split out rubbish UTF-8 code.
Warn if file appears not to be UTF-8. Refs #1172.