Implement rev query parameter for HEAD, GET, PUT and DELETE requests.

Really nice! Please also add a test that the same `409` result is also given when using `?rev=` query parameter instead.