Refactor proxy-enabled payload handling

This fixes a couple bugs and generally cleans up the proxy option parsing code. 
After digging through documentation, it still isn't clear if IPv6 addresses are handled for a proxy configuration, so this likely needs a field test before it can resolved either way.