Router

Trie implementation + tests
Router using it + tests
no, it sorts every children according to the priority, starting at index i and goes up to the front of the array where it might have to reorder more on the way