added newline before END_FUNCTION, as otherwise it was appended to another statement sometimes
improved diferenciation between function declarations and definitions
improved unit test support while loop support function declaration