Declare variable 'ffi' in global scope

also add bitops and whatever other runtime bindings we need, and don't fall back to _G