Add waitForConfirms to promise API

An experimental waitForConfirms. This one works by replacing each
callback in the unconfirmed messages window with a promise-resolver,
and returning a promise that resolves when all of those do.