More tests.
Eliminate redundancy in promise_handler implementation.