Simplify promise-handling code
Re-throw errors from transition hooks

Fixes #21