Factored out web secrity modules, GEOS-5972. Fixes #357.