Allow functions to be passed to executeAsync

Fixes #92.