Shared base class for ClassNode and TraitNode