Fixing broken collection removal.
Expanding headers directly to a list of key value pairs, as it makes troubles when used as a lazy evaluated list. Somewhat related to #276.

(cherry picked from commit ef63a57eb1b8bc106edf2767728c7f280fbdb2a1)
Fixing missing check in referenceable dataset renderer.

(cherry picked from commit fdbc9da6e10e9253c88208d198ffc045bf2f3248)
Merge remote-tracking branch 'upstream/wms_new_layer_factories_clean'