implemented trait
added test for trait template
finished test for traits,finished tests for generator itself