Changed hook callbacks a bit; now they are executed with the instance context and are no longer passed a values argument.

Refactored hook tests