TreeSort was very broken, fixed now. Working on tests. Added indexOf function to stay true to "got it in an interview".