Allow 3rd parameters to either use array or closure.

Signed-off-by: crynobone <crynobone@gmail.com>
Add additional test.

Signed-off-by: crynobone <crynobone@gmail.com>
Merge branch '2.1' into 2.2