Fixed new plugin hooks
Revert "Revert "wip: Implemented finer grained plugin hooks""

This reverts commit b436f2e03548eeccd330b2c3c63a99ee87e4b908.
Merge branch 'hooks' into plugins