Reexporting castBool and fromPairs

Ansible module now reexports this functions directly.
Introducing functions thenFail and otherwiseFail

- Both functions are implementation of commonly occurring pattern:
    - "when predicate $ fail message" now becomes "predicate `thenFail`
      message"
    - "unless predicate $ fail message" now becomes "predicate
      `otherwiseFail` message"
- Function moduleMain was refactored to use thenFail.