Rename before_remove_attr and after_set_attr to allow reusing those names in the next commit.
Add support for trait-based virtual methods on Nodes, and use it for before_remove_attr and after_set_attr.