Added functor/lambda support to WorkQueue