reoragnized API; fixed a bug in AST dumps