Add legend insertion hook and execution points

Writing a plugin that wants to execute as soon as the legend has been inserted. Adding a hook.