Add support for class member variable

supersedes #1417
That was when you only transformed the class elements.