rewrote LegendControl behaviour

Now there is only one LegendControl for the map. This control knows
about the images of activated TileLayers and hides itself when there's
no legend image to display.