MRG: support for variable updates in vm.Loop

... and a little bugfix in the ShapeOptimizer