Coverage tests

This fixes the coverage tests and makes it possible to generate them without the java comparison tool (we probably should port it though).

runing 
```bash
./autogen.sh
./configure --enable-lcov
make && make cov
```
now generates the file coverage_percent.txt which shows line/function/branch coverage of the unit tests, as well as very detailed html reports in the folder total.coverage which show down to the line level what is covered by the unit tests.