Moved binsearch_* functions to utils
Unified tree structs