Fix so document directory structure in source is reflected in output.

Prior to this, a document under <srcdir>/mydir/doc.ad would end up in
<outputdir>/doc.ad instead of <outputdir>/mydir/doc.ad.