Promise-based interface

Attempt to make the control flow explicit and more error-aware.

It also makes the user code shorter as there is less `if (err)` statements to deal with.