Refactor bindings to reduce code duplication with multiple backends

Refactors the bindings for OpenSSL such that additional backends will have minimal code duplication.

refs #344