Implement Socket, ProxySocket and minor connect changes