Implement validating ObjectWriter

- ObjectWriter now validates state to ensure that valid objects are
written.
- Removed the obsoleted state machine from JsonObjectWriter and instead
override the new WriteMemberSeparator and WriteArrayValueSeparator
methods of ObjectWriter.