DocumentGenerator treating traits in line with ORM

Fixes #297 

This has been ported from ORM PRs:

* doctrine/doctrine2#632
* doctrine/doctrine2#763