Minor DRYing of gateway code, added :save option for get_edgegateway.