Fixing Luarocks

Closes #32354.

Primarily, this fixes Luarocks. It also adds a shared, simple test to Lua & Lua51, tidies up all formulae involved, and revisions all 4 lua-something formulae. 

Theoretically, this could work without revisioning anything other than Luarocks, but doing it this way is much cleaner, smoother and reduces the risk of a lingering lua screwing this update up for users.
> if we fix this with luajit because of luajit's internal dependency on lua51 then we need to fix it with lua51 as well.

Is it really right that a rock would need to be installed once for luajit and once for lua51, or just once for lua51, or...?