Fix stdlib reference in web interface
Refactoring to make the AST more structured and "type safe"
Minor refactoring to avoid a bit of duplication of code