separate treesearch to treeexec and greedyexec

Also expand docstrings