Add exclude handling for files like .DS_Store, Thumbs.db etc.

Inspired by http://stackoverflow.com/a/5141829
(cherry-picked from 889bc82)
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
(cherry-picked from ea82b87)
Whitespace fix
(cherry-picked from da7e092)
parse_json attempts to convert {changed,failed} to booleans

this allows is_changed to just check the dictionary value
additionally it attempts to change the return code to an integer
(cherry-picked from f6e5387)