concurrency fixes
it was possible that if object A was already being saved
and object B required A.id, then it would take A.id
before A was saved.
This is now fixed such that all dependent objects strictly
wait for their dependencies to be saved before attempting
to get their ids. This happens even if the object is already
being saved by another operation. (the promise is shared)
On the other hand, we don't wait for all one to many objects
for an object - which don't have a dependency relationship.
These objects are added to a queue of objects that need to
be saved before the top level object can be considered
completely saved.