CTFE JIT compilation, step 1: walk AST, check integrity

First step towards CTFE compilation. Walk over all expressions in the function, counting the number of VarDeclarations and checking the validity of the AST.

(I actually wrote this code about a year ago. It uncovered a HUGE number of bugs in the front-end. When it passes the pull tester, it means we finally have a valid AST for const-folding, and error propagation is complete).