WFS from metadata

**Do not merge yet, please**

Someone can start a code review on this work. The metadata is not updated yet to use this new functionality so this shouldn't be merged for now. When the metadata is updated I will also do a bit more testing.
Oh, I had a feeling I saw some of these changes.

Please rebase your branch against master and `push -f`?