Fix for #4542 -- included classes weren't assigned proper stages
This commit unifies the code paths on which classes are added, alters the default
stage to respect the stage of the parent if any, and assures that the resource is
notified if its stage is assigned (turning an implicit stage into an explicit one).