Snapshot support

- Implemented snapshot support. A snapshot can be stored locally and the hasChanges method will use a snapshot to see if there are changes if a snapshot is available.
- Clone no longer copies fields that start with $
```js
assert.throw(function () {
    doc.snapshot()
});
```