Improve tree index generator for visual tree

* algorithm improvements
* new dummy documents structure for testing