Many ref-cnt fixes

Broke up AST into ASTOp and ASTFunc files