Simplify async calls in unit test code by converting errback-style functions to return promises