Coverage

Implement coverage reporting and improve testing.