Fix for loop plus several other bugs

For loops didn't respect 'to' or 'downto', and also did not increment or
decrement the loop variable. Fixed an infinite recursion bug in the
register allocation and fixed string literals to allow ticks inside of
them.