Add support for class member variable

supersedes #1417
No. This needs to be public since sub classes depends on it