This is a bit trickier than just slinging existing functions about and
tarting them up a bit: it introduces a proper interface to parsing hash
files, which previously was interleaved with actually verifying the
hashes.
Also moved a couple of auxiliary functions which are needed by the moved
code.