* Drop <err.h>, which is unnecessary since we use libxo.
* As per POSIX, report an error if output fails.
* Fix some type mismatches.
* Use bool instead of int where appropriate.
* Avoid repeatedly checking for a null filename.
* Miscellaneous other tidying.
* Add rudimentary tests.
Sponsored by: Klara, Inc.