compiler: rewrote Compiler as AST visitor