Add support for class member variable

supersedes #1417
I'll also add transform for untyped variables