AST API Refinement
AST API Refinement

Removed .parents(), .indexOf(), .remove, and .get();
Will only put them back when they're certainly needed.

Faster manipulation methods: splice(), before*(), after*(),
insert*(), replaceWith(), prepend(), append()

- The API now takes an element, or many elements wrapped
  in an array instead of variable parameters. This saves the
  API from creating, passing, and ultimately garbaging many
  Array objects.

- Optimize single element insertion; Avoid Array processing
  pipelines like elems.map().filter()... unless needed, which
  are slow and generate lots of garbage.

- For .prepend() and .append(), use .push() and .pop() to
  avoid garbaging empty Arrays from .splice() calls.

- Limit the number of garbaged array per .splice() call to
  one. Still expensive, but better than the 6-7 in the
  original implementation.


Use accessor methods across the API instead of
direct property access. This is done for the benefit
of future extension and debugging.

Simplify higher-order iterator functions for node
childrens:

- Callback can only access a copy of the children
  array.

- For filter, map, and reduce, return a replacement
  node containing the new children array instead of
  the original node.

- TODO: thisArg: By default, the node that called its
  method. However, there should be an option to specify
  a different context.

Preole/bbm,Preole/bbm