Implement treestore sorting

This makes it possible to tell TreeStore to sort the rows by one of the columns. Implemented for GTK and WPF. Mac is impossible for me to do since I do not have a system to test on.