builtin/apply: move 'fn_table' global into 'struct apply_state'