Add support for new "document" content type in scalarapi.js

This fixes display of annotated text content. Also, tweaked the display
of text annotations in the media sidebar.