Add sequence, which collects an array of actions into an action computing an array.

Swiped more or less from Haskell's [Prelude](http://hackage.haskell.org/packages/archive/base/latest/doc/html/Prelude.html#v:sequence).