Iterate over files and directories in a stable order.

This avoids spurious diffs caused by generating e.g. the Maktaba flags
in an unpredictable order.

Fixes #75.
Merge pull request #77 from malcolmr/stable-ordering

Iterate over files and directories in a stable order.