refactor Lua compiler to be a dispatch table instead of mega if elseif code