Implement buffer to post extraction.

Turn a concrete buffer into an abstract representation of a post, so
we can manipulate it further in fairly standard ways.