Async support for hooks

Hi, I propose this update to the hooks system to support async style hooks. I've made it backwards compatible to sync hooks by checking if the return value is a string. There are perhaps slightly more optimal ways of doing this, but this passes all the tests.

I used this to integrate closure compiler with the postcompile hook.