OSM support

Final touch before merging #780