Exclude generated classes from PHPUnit code coverage
Add more tests, fix a few bugs found thanks to the tests