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.

That's interesting. We need to investigate more regarding buffering behavior.

It currently uses bufio to write a single request: (length | record).