Misc fixes
Move FFI stuff to submodule