Add isMain / isOperator flags to AST nodes, clean up pretty printer