Implement hooks framework
Once #778 (closed) is complete, the actual implementation could start. The goal of this ticket is to implement the framework, i.e. the ability to load external hooks, be able to report them, and call some limited callouts.
If needed, this can be split into separate tickets for front-end and server hooks.