Implement var as value analysis

FIXME: this pass has not tests