Adding compare function to tree for children list
Adding tree index function

- Needs tests
- Allows for future refactoring similar to that done in list