Refactored OpenSSL stuff into separate library