Fix viewport scoping

Fix scoping issues using ModuleContext. This ensures that function evaluation is done in context of the root module.

Test case:
```
function f() = sin(360 * $t);

d=80;

cube(10);

$vpd = f() + d + 50;
$vpr = 50 * [ f(), f(), f() ];
$vpt = -20 * [ 2.5 * f(), 0.5 * f(), f() ];
```