Fix two bugs in DocNode's comparison operators and add a new
Document::copyNode() method:
1. operator== was implemented via operator<, which hits llvm_unreachable
for Array/Map nodes. Implement operator== directly with recursive value
comparison for all node types.
2. operator< compared KindAndDoc pointers, causing cross-document nodes
of the same type and value to silently produce wrong results. Compare by
kind then by value instead.
3. Add Document::copyNode() for deep copying nodes between Documents
with independent memory ownership.