Add support for class member variable

supersedes #1417
Would this work in case of a static property ?