Move FFI logic into relevant submodules

This is in preparation for adding support for libsodium's random-number 
functions. Rather than shove more into one FFI module, this paves the way for
having FFI logic grouped into focused modules.