More useful and idiomatic conditional operations

Rebased version of #23