Factor out text rendering.

Allow plugins to be composed pre and post markdown rendering.