Refactoring of tree model code generator.

Now, the generator should support larger trees
produced by DRF. The main obstacle was caused by too large
methods, which is now solved by splitting a method representing
one tree into several methods representing individual subtrees.

The new methods are still part of one class representing a tree.
Hence if there is a problem with size of class's constant poll we will
be able to move the methods into dedicated classes.