Add support for class member variable

supersedes #1417
This needs a recursive transform call since there might be nested classes.