Ssl wrappers

This adds C++ wrapper classes over PolarSSL's API, to provide proper RAII management. Also got rid of the PolarSSL's `net` module calls altogether.

Fixes #924 and partly #931.