Turns sync functions into Node.js-style async ones.