First implementation of tree and tree_qa commands.