Replace flatObjectsAreEqual with objectsAreEqual

Replace the utility method flatObjectsAreEqual with objectsAreEqual
so objects with nested properties can be evaluated for equality.