parse AST to prevent XSS attacks. closes #3