Keep smart folders when sorting. (see #12294)
Remove commented code and comments

No longer required.
Make sure the smart folder is always at the bottom.
Merge pull request #2549 from jburel/orphaned-missing

Orphaned missing