Changed index from Set to int list

Rewrote part of the tree to use index represented as int list instead of
int Set, for performance reasons and to potentially allow for duplicate
indexes.
Added minimal unit tests.