Remove code duplication in geogit-web-app/geogit-geoserver