Check document for stdClass type, for consistency.
Split document tests out to DocumentTest.