Fine grained durability

Add support for logging and recovery, to give transaction-level durability.