(Work in progress) Implement a typed AST.