Text file preview

This PR adds support for previewing text files.

Depends on #661.
This is an issue coming from #661 rather. We're looking into it.