Refactor variable parsing.

Now in the Variable class.