Move Tree and Cartesian classes into dedicated gp module