Revert "Remove stuff that depended on ffi"

This reverts commit ce86abfa0b712dee7974e8d054deeefb7ad52e68.