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.

This is not upstream, this is just a pull request towards upstream. I'm just pointing out things that doesn't make sense in the pull request.