fixed remove() to get rid of removed element refs

removes from $self and from all $self->{before}.

Also modified how each() instantiates the objects, so $_->end works in the callback, which is needed for $_->remove() to work in the callback.