Convert to a promise-based interface

Because this type of interface is much more organized and easier to deal with.