Test if lua function exists before registering them