Add code-coverage generation and unit-tests

This adds a bunch of unit-tests and code-coverage generation with HPC.
Adding code-coverage enforcement will be pretty hard, as this code is
currently really hard to test and HPC is pretty hard to configure
properly.