fix #6292, allow global/local declarations on short-form method defs
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.
Old REPL behavior navigating history with up/down keys
Fix #6328 (get out of REPL modes with backspace)