Fix for issue #695
This MR rewrites the flow control logic to use a stack to build block of statements that can be executed instead of tracking the block level separately.
The statement execution got also reworked, as there was a lot of duplication of what execute_statement
should do.
Also instead of FlowControl
tracking if modes, it now part of the If
struct to make it easier to push statements into different branches.