look up and update existing memberships when restoring

We can't save the stored one as we're storing JSON to make sure it's a
reference we're storing
add post id to new membership if missing
process inline memberships in series

if we allow this to happen asychronously and there's an error in the
process then the error handling and state restoring code can fire while
we are still processing some of the updates. This means that we won't
restore/delete created memberships correctly.
handle errors in processing inline memberships in PUTs
expand test coverage for inline memberships

tests for organizations, posts, restoring docs and memberships and
deleting created memberships