Added support for automatically select Lua 5.2 is it's available, then falling back to checking for Lua 5.1 otherwise.