Make the legend code a bit more tractable.

Expand nested list comprehension; only send legend translation variables
to pandoc when we’re rendering markdown (and not when we’re rendering
menus).
Merge pull request #64 from andylolz/52-list-incomprehension

Make the legend code a bit more tractable.