first version of connection reusing.
updated code to detect whether socket is still connected.
Moved ssl into plugin directory
Merge branch 'dev'