Add subscription API. Move FFI imports to their own file.