Added hooking, so Lua can be caleld automatically from C++