CLI mods

Previously we use exits all over to break the flow in the cli module. I believe this patch is a better solution!

Comments please.

Changes:
- correct exit codes on error
- refactored to use and if-else block, so we only exit on success in one place
- changed query option to be exclusive of other options; the same as others in the list (this the only functionality change; look at bbbd10c)