Turn a regular node function into one which returns a thunk