tls refactor: server and client working
remove old tls code
Merge pull request #560 from luvit/fixes/tls

Fixes/tls