Fix broken tests:
- When inferring type of ObjectNode with no docs (or no docs with @type tag), assume Object.
- Add sanity check and test case to enforce that a type cannot have itself added as a parent (which is what was happening to break the tests).