plugin/document: Consistent type for title

The Document plugin was sometimes setting metadata.title to be a string,
and sometimes an array. This commit makes sure title is always a string.

Fixes #442.