Improve sorting

/Utils.Sorting.hs
We moved the sorting algorithms to a seperate module and now check for
idempotency.

/Utils/Tree.hs
We improved the generation algorithm for the tree building.  It will
give us a balanced tree now.