Added initial referential document support.
Added test to ensure saves with no changes behaves correctly.