add createDeferred function in node/function for creating deferreds that call nodeback on resolve or reject