Add event support to JS FFI