Factored wfInvoke out of wfRunHooks. This time without breakage. (I think.)