Add support for sorting and display of size/modtime.

The 'detailtoggle' can be used to cycle through the 3 modes. Sorting and
display are currently coupled together.

Preserve the current file in rebuild() if possible.