Exit codes + quaffing for executables

If the error is expected (`EINVALID`), exit 3. If the error is unexpected, exit 1. Also simplify these executables by using the quaff function.