Sort files and folders

This fixes #85.
Merge Bruce's sorting of folder listings. Closes #86.