fixes on tree index, and add N consecutive max search
add tsv output, do not send logs anymore to stderr