Allow hooks to return a promise

This pull request adds the ability for a hook to return a promise as described in #3.