Starting up a test suite for the Element API

We are generating a lot of reliance on wasAdded and wasRemoved, which are subtle and not quite up
to major use cases yet. It will never be awt, but we can perhaps have some middle ground.

In any case, this will help pinpoint the guarantees tripleplay customers need. As a case in point,
both trasfer tests will fail without the next commit.
Make wasAdded and wasRemoved more reliable

It's probably unrealistic to provide a 100% pairing guarantee, but this at least allows Element&s
to be added or removed during a wa/wr call, an important case for us.

I considered possibly clearing the flags in the same place where they're set, but decided to use
Element's wa/wr implementation. This has the benefit of allowing subclass wa/wr methods to call
the parent either before or after they manipulate the hierarchy.