extend test
always wrap for-iterator node in NextNode after analysing it (might have been replaced)
extend test
make sure foreign entries are reused
revert incomplete fix for ticket #600: not enough for more complex scoping and evaluation time issues
always wrap for-iterator node in NextNode after analysing it (might have been replaced)