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.
Basically everything up until `option`.

I think fixing this to work with `lua` is necessary (if that wasn't a previous PR) but I don't think we should go beyond that; as far as I can tell only one user has requested it and I don't think we should make relatively invasive, potentially buggy changes like this that require lots of revision bumps for a single user when the silent majority are happy.