use `cim_error` and `cim_message` for error and message instead of simple `echo`
use `__which` in place of `which`.

`__which` uses `command -v` rather than `which`.