add when_failed, when_changed, and extended when_set/unset

This commit extends the 'when_' conditions to failed and changed
json results

Additionally it makes when_{set,unset,failed,changed,int,str,flt}
behave more similiarily in that they all except and/or/not logic