Fix flatten.

Flatten was throwing out arrays inside arrays instead of
flattening them. Whoops.
Add inArray, since Array.indexOf doesn't work in IE8.

Basic fold-based search.
Default element attributes to an empty array.
Extract classes array if a class attribute is present.

If not, we end up with a simple array.
Elements now carry node names. Whoops.
Extract selector and update functions simultaneously.

This is because the update function may throw out part of
the selector before we actually build the selector function.
For example, 'body *' means replace the children of body
with the generator, but the selection part of it is only 'body'.

Selectors still aren't parsed and always return true.
Add basic selector extraction.

Currently we don't support descendant selectors, just one
tier of them (selector[ replacement-rule]). We also only
currently support element name, id, and class selectors.
Flatten children when updating them.

Otherwise you can end up with a child generator that returns
a list of elements that don't get integrated into the text
children of the parent, for example.
Properly split class attribute on whitespace when extracting classes.

We were splitting on a regex but passing it in as a string.
Whoops.
Strip debug output from idSelectorFor.
Drop last referecen to the parent property.

Lightweight elements won't be able to traverse upwards.
replaceUpdater no longer flattens non-arrays.

Sometimes the generator produces a non-array value—for
example, a new version of the element. In these cases, we
do not flatten the result, since that would produce an empty
array and lose the updated value instead of replacing the
existing value with it.