mappedby field of embedded document throws notice
Add regression test for #566

There is a separate, unrelated bug at play, which requires storing the references in a second flush.

Additionally, this test highlights an issue with PersistentCollections growing stale and requiring manual reinitialization (possible feature improvement).