move foreign function interface to its own module