Implement most of the warning & performance points from my annual CppCheck run.
Most of these are functionally equivalent but are slightly more optimal, most are just a recommended way of doing things.
Fix an actual bug where we weren't checking against both registered joystick buttons.
Add a file (matrix3x3.h) I noticed wasn't in the VS solution.
fix gcc -Wold-style-cast warning
fix some gcc -Wreorder warnings
assert that we get a valid Root enum value in LuaFS ReadDirectory

An invalid value should be caught earlier on (by
LuaConstants::GetConstantFromArg)
Merge remote-tracking branch 'jpab/cppcheck'