Add support for map-contextual WMS legend

See http://hub.qgis.org/issues/11859