Add a public C api wrapper

This allows calling the library from C code.