Split core and UI of the text document inspector.

Content preview and bounding boxes don't work remotely yet.