Removes dynamic calls of before/after hooks and replaces it with proper lookups for hooks defined for the action to run. If hooks are found for an action, the action is placed in a new builder and the hooks are applied. The new stack is extracted, finalized, and then executed.