Basic resource management for LuaTeX code
