Revamped sorting algorithm. Now uses QStandardItemModel::sort().
Changed some other stuff too.