fix for PLFM-1662
fixed some tests and added more
fixed tests
addressed issues raised in the code review
Merge pull request #264 from john-hill/develop

Fix for PLFM-1662
Merge pull request #265 from eric-wu/develop

Enforce the correct write order for ancestor-descendant pairs