Proxy support and custom endpoints

Added support for connecting through a proxy and also added support for custom endpoints.

I would rather have used the Region/Regions objects instead of using strings for the custom endpoints, but it seems the SDK wants to download regions.xml from somewhere to create the Region objects and that call can't be passed through a proxy so it hangs.