Pre-emptively touch ~/.kosmos .

This avoids issues of that file not existing.
Open zip files in binary mode.
Do not call #exit anywhere.

This was an acceptable way of doing things when the only interface was the CLI,
but now with the web interface extra care must be taken to propagate
unrecoverable errors by hand.