Validate object graphs for cycles in composites on first commit

Also fix a bug that was breaking validation of COObject instances in relationships when there's no user-supplied subclass.