Changed functions to use maybeAsync for common pattern of calling function immediately if not a promise and asynchronously if a promise.