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.

Thanks for doing the due diligence before adding a feature :)  

To clarify, most of stuff we were discussing here is buffering instead of caching. Caching is a super set of buffering in the sense that you can read from a cache but cannot read from a bufio writer.