Made member fully exist in sim before memb.added()

Previously, the member id and simulation reference were set before the
member was added to the appropriate Simulation storage, which meant
that attempting a lookup of itself during added() failed; this meant it
wasn't possible to create dependencies in added() if those dependences
relied on being able to look up the depending class.  (In particular,
this affected Creativity: adding a Book attempted to also add a
BookMarket during Book.added()).

This commit reorders insertion so that member exists during added().

It also reorders removal so that the member is already removed from the
Simulation storage when removed() gets called.