Revised parse_if_statements-function. Foreach loops can now take a dot notation key as the argument.