Cookie rewrite option

I added an option for cookie domain rewrites which is used to support setting of cookies across the proxy. 
requires should go at the top level instead of inside functions.