Hooks: Fixes Python/Lua types. Fix Lua library requires.

Uses Lua tables instead of dicts when needed. DLFCN to allow Lua
libraries to be linked properly.
Works around SpooledTemporaryFile.name attribute missing.