Consolidate mime type functions.
Fix text highlighting bug.