Better logic when saving data contexts
Better logic when saving data contexts

1) Mark the parent document dirty the first time we save a data context
(which replaces the data context with an id reference in the main
document)
2) Make sure we update the shadow copy after the first time we save a
data context, so that the next save will have the correct differences.
3) Make sure any time a data context fails to save, we mark it for
saving again next time.

concord-consortium/codap,concord-consortium/codap,concord-consortium/codap,concord-consortium/codap,concord-consortium/codap