util/when: first implementation
util/when: fixing chain resolution

Also will always resolve with an array.
0.3.1
Merge pull request #43 from Aintaer/when

util/when