This re-implements the binary cache database in C++, allowing it to be used by other Store backends, in particular the S3 backend.
In particular, this eliminates a bunch of boilerplate code.