Add support for class member variable

supersedes #1417
Care to change this to `pushMemberVariable` and `popMemberVariable`. The accessor here has side effects which are not obvious.