Class attr rework

NB: Backwards incompatible changes in `get_type_hierarchy`