test for id before setting it to a new uuid, to avoid overwriting

Trying again on the right repo.

We need to make sure with this that components can be serialized and reified without changing ids. I don't actually know how we do that yet.