view: limit sorting to only the branch and tree view
view: fix comparison of modes when sorting by file name
view: fix number comparision
branch: use reference comparator from refdb module for sorting