refactor tree behavior into smaller better testable and usable methods

you can now also make a custom find(all) query with order "left asc" and use the formatTreeList method manually.