Use RvalType in UnresolvedVariables
Add unit tests for extracting scalar, list variables