Adding wms_store support

Rework of old PR to add support for cascading wms stores/layers.