More python2/3 compatibility.
Clarify spec, and fix fs.py to properly sort entries.