Generate traits for the generated bindings code to call.
Call the generated rather than the hand-written traits (fixes #2936).