Fixed terminal parsing and changed BasicAST

Now all terminals will be computed from ASTs just as they are parsed into ASTs:
as though they are POS-tag type things. BasicAST has also been changed, to
reflect the tree (internal node)/(leaf node) distinction.