Add Tree layout. Refactor layouts with basic prototype inheritance