Add CFFI alternative to ctypes

Further optimization is still possible but this allows us to move over
to CFFI which will hopefully prove faster and is definitely easier to
keep in sync with the upstream C API