fix-up trait parsing
add trait parsing tests
remove unused code