Document and clean up texturelist.
Document and clean up wad.
Document util.
Improve handling of invalid input files.

Do not write textures if none were added, and avoid writing empty
namespaces.