Tests refactor

- generator separated from teardown
- test-treedb modularized for multiple tests
Parameterized gen objects in test.