subclassing support
set type field automatically
need to check class, not instance, for attributes. durp!