If test returns a promise, complete test when promise resolves

Thanks @jschilli for reporting this and working on the solution.

Fixes #23
Fixes #24