add log abstraction to store records in disk

@xiangli-cmu 
This adds _log_ and _message_ abstraction.
I haven't thought about how to batch encoding yet. It had better be considered in snapshotting.

Nope. You can keep a downstream branch without buffer. I don't understand OS so I will keep it in upstream.