Temporarily remove rewrite support

The way rewrite currently works is incompatible with the monadic-style
IO which will be introduced in a later commit. This commit removes the
rewrite support temporarily, so it can be easily restored later (by
reverting this change and adapting the result where applicable).

Change-Id: If8c59d60779235bd1e3db1fc896c518fef1411cd
Rework into monadic style

This commit changes Baardskeerder all over the place, changing the
Log interface to allow for various IO mechanisms, so we can create an
Lwt-backed Log implementation.

More information on the rationale behind this can be found in some blog
post on the Incubaid Research blog (once published...).

This commit adds a monadic interface to Log ('a m/bind/return/run),
converts the Tree module to use this new interface, and updates test
cases to compile and pass.

One drawback: the 'Rewrite' module can't be converted as-is, and as
such rewrite support is no longer provided, for now.

Change-Id: I47fc8ab5ef23f01b87cd8cdea83a243f6c79f50f
Add Mlog_lwt

This module is a simple wrapper around Mlog, but acting as if it's
backed by Lwt. It simply passes all calls to the pure Mlog
implementation it encapsulates, and lifts the result into an Lwt.t
value.

This is a simple test to check whether the changes introduced in
d98a85cf can actually work in an Lwt-based application.

Change-Id: Ib9e1233f726707d011b251f5ebde9135d61a97eb
See: d98a85cf66d06be3bb9d1c280706de9b10438769
Add Store module

This module defines the STORE signature, and provides 2 implementations:
one using an in-memory string, another using a file and synchronous IO.

Change-Id: I942662d48d34a669666e2c5b25b1b0b65a86634d
Add several utility functions to the Monad functor

Change-Id: I1091cd9f6f328ecf3d05e55c6cc2db70ed54dbce
Functorize Flog0

According to the new way of working, serialization implementations
should be functors over a Store.STORE module to result in a LOG
implementation.

This commit alters the Flog0 module to provide such a functor, and
updates the places where the plain Flog0 module was used before into
Flog0 applied to the Store.Sync module.

Change-Id: I3c057629f4b6d452517e331a41c9adac985cf7d3
Revert "Temporarily remove rewrite support"

This reverts commit e41ffdceb7fc60eb404d2635e603059e581b1eb4.
Store: Use Buffer.t for in-memory store and implement write

Change-Id: Ib56e18d9d4f826fdcaa42de521380e3c74e197d3
Rewrite: Fixup rewrite implementation

This commit fixes the revert of the removal of the rewrite code in
2d21f23d82 to compile again, using the new monadic based API.

This requires the test suite to use Flog0 (against Store.Memory)
instead of Mlog since Rewrite now requires serialization functors and
storage modules to be separated.

For now, also using bsmgr, only Flog0 databases can be rewritten.

Change-Id: I2438daf37eac799ec1f543785d9ca44a02475ce4
See: 2d21f23d82020c8c37579da36ee314fa8f22a2de
See: e41ffdceb7fc60eb404d2635e603059e581b1eb4
Merge branch 'lwt'

* lwt:
  Rewrite: Fixup rewrite implementation
  Store: Use Buffer.t for in-memory store and implement write
  Revert "Temporarily remove rewrite support"
  Functorize Flog0
  Add several utility functions to the Monad functor
  Add Store module
  Add Mlog_lwt
  Rework into monadic style
  Temporarily remove rewrite support
Store: Add Lwt-backed store implementation

This commit adds a Store.STORE implementation using Lwt for performing
IO. This allows for Baardskeerder to be integrated in Lwt-based
applications (e.g. Arakoon).

A small test-application is included as well.

Change-Id: I1a216050f3b41dade209e8873b996934f813542f
Posix: Add Lwt bindings for pread(2)

Change-Id: I75351c48734fbfdab48af01474982a4600442299
Store: Use pread(2) in Lwt backend

This commit alters the read function of the Lwt STORE implementation
to use the pread(2) bindings introduced in 0efb9f375 instead of
lseek(2) and read(2) calls.

Change-Id: I5a9c8916182a0a9ca4a0cdce66467ecd04f2a5ff
See: 0efb9f3756e9cd6d899170290ff3ea985ad63b1a
Posix: Fix exception message in Lwt pread(2) job

Change-Id: Ieb5fead0b59683d4b94ea48b9ced958a4ce8c28a
Posix: Use long instead of int in Lwt pread(2) bindings

Change-Id: I7f29a710c400d6c594008a1c4a4e2f6cd37df325
Lwt/Posix: Add pwrite(2) bindings

Change-Id: I343961b48aed47e4b65397e8e06c1a7c38a3e1da
Store: Use pwrite(2) in Lwt-backed STORE

See: 21c2aea80cba3fce050781b52d638e8b0d4bd639
Change-Id: I478e29df1a3c45e4051a207c93a6e4400da13ce5
adding lwt stuf to baardskeerder META
fix .ocamlinit
Store: Add with_fd interface

Change-Id: I8b658851b5e7af85e62596894e61c1d3804c86f2