Refactored out common logic
Some refactorings + more precise integration tests that parse actual xjc
output