Fixed variable lookup when scope has changed

This fixes fetching the value of a Variable when the current scope is not the scope in which the Variable is declared.

This fixes the following code:

``` php
<?php

function x ($x) {
    var_dump($x);
}

$y = 1;
x($y);
```

tests/lang/022.phpt now passes
tests/lang/static_basic_001.phpt now breaks (but should be fixed separately; this is caused by compiled vars being shared between function calls)