Changed initialization so the plugin class executes hooks in run function.