Support enqueueing callable classes.

Fixes #388.