Convert asynchronous function calls with callbacks to es6 promises