Added promisify utility function.