Move all document-display logic to the client side.

Refs #433. Unfortunately, there's more work involved for Facebook URLs:
we'd need to write templates for each type of URL.
Fix the translations mess from joining PublicDocumentSet and SharedDocumentSet