Store item revisions and check subtree consistency after a 304

Given the lack of reviewers during the last weeks, i'm creating this PR straight off my dev branch, which is a little bit "ahead of head". It's basically master, plus:

* fix-anonymous-mode-queueing
* gd-dir-querying
* quotes-on-ETag
* rename-busy-events,
* versioning-improvements

so don't merge this pull request until those other 5 have been reviewed first.

to do:

* [ ] add tests
* [ ] try if the consistency checking is actually efficient enough, we will probably need to cache results for subtrees.