Added while function, if function, and more semantics actions clean ups involving multiple test checks.