Basic test coverage tool

Added a basic, and probably quite flaky, test coverage tool based on `lcov`. We can use this to track our test coverage and ensure we're hitting all the code paths with the test suite.

To use:
* `make clean` to remove object files built without coverage support.
* Re-configure with `--enable-coverage` in addition to your normal configure flags.
* `make coverage-report`
* Look at `coverage/index.html`

Note that you'll need to do a `make clean` any time you switch between a coverage build (which disables all optimisation) and a normal build.