SSL Rewrite

Rewrote much of the underlying SSL initialization and negotiation.