Added beginnings of conversion of daemon.c to FFI.