Changes to make the gateway act moer like a general proxy gateway

The goal is that this can be remapped at any time with out issue, so that updates to the proxy doesn't mean much work needs to be done here on the gateway extension