Write operations in core

This is probably easiest to review commit by commit.  

The first commit is just to use Delete instead of Remove in core, to be in line with the server and the CRUD spec

The second and third commits are about removing the distinction in core between update and replace, except at the lowest levels where we have to do validation of those documents.

The fourth commit is just some cleanup that I noticed while doing the third.