expose the C++-style API

This is a straightforward wrapper of the C API that resembles NaCl's C++ API.