Fixed a lot of should-be-local variables

Like @wiox did with garrymod's 'light' stuff using
https://github.com/wiox/gmod-global-finder. Manually inspected each
variable.