Allow hooks to return a promise

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