Added unresolve_var

Switched resolve_var into using has_var instead of directly
accessing the data structure.