Implemented generic "vars" property (attached to state) plus tests