Fix deepcopying of documents to prevent excessive wrapping of Document instances within each other.

This has the effect of breaking change tracking for the working model passed to event handlers in everything but the model's root node.
Added a generic  scope to allow easier combination of arbitrary queries with other scopes