add function def parser and tests
revert to old correct statement typechecker behavior
clear local scope when we start parsing a new function