Cosmetic separation of the legend functionality into a new module, #25.