[Bug] DBObjectCodec always serialises the ID first, so any query document (i.e. document that isn't a storage document) that specifies it in a different position will fail, as it always gets moved into first place before encoding.  Wrote tests to prove the failing cases, and also move all the sort tests from DBCursorTest into DBCursorFunctionalSpecification (this is one of the areas affected).