Add support for class member variable

I am looking for:
- feedback on the implemenation,
- how to debug (currently I'm doing make + node debug which is not the most user friendly workflow),
- what kind of test should be added.

/cc @arv 

The extra var has no performance benefit and leads to harder to read and maintain.

Also consistency matters.