New hook system

New hook system that allows better scoping of events, main advantage is better automated tests for classes using this system compared to OC_Hooks.

Not meant to replace the existing uses of OC_Hooks, instead meant for new classes that want to provide hooks

More info: https://gist.github.com/icewind1991/1e315e6e75c106406405

Required as part of the improved filesystem api I'm planning.

cc @MTGap @Raydiation @karlitschek @DeepDiver1975