Fix scope issue in simd loops

The iteration variable being declared local raised errors
when using the simd macro twice in the same scope.

Also, it now behaves like normal for, i.e. if the iteration
variable was defined, its value is updated at the end of the loop.

Also, code cosmetics.