exportlegends can do site maps, IDd field

Expanded exportlegends.lua to handle site maps as well, and improved precision of args.  Identified `vs.anon_21`; I'm not sure what the process is so I've used it here and noted it's discovery.