Implement sorting

This pull request implements sorting using the sorting id. It's uses sorting mode 4, to enable drag and drop. 

Displaying the theme as header should not be an issue.

Sorting is recognized for import and export as well.