Moved FFI functions into their own file.