Add support for WebMapService maps. Some refactorings