collect attributes from self.__class__ instead of self

This prevents properties from being evaluated when collecting commands.
Merge pull request #221 from hamr/stable/2.0.x

collect attributes from self.__class__ instead of self