This untangles some of the gigantic kitchen sink headers
in an attempt to split things into smaller files.
Also don't include gl.h, glext.h, windows.h,
and other such nonsense *everywhere*.
Lots of cleanups on the way too. More dead/unused code removal.
Remove incrFlag(), decrFlag() Lua functions.
Because of wrongly set firstFreeIdx some pointers were NULL, where they
shouldn't be, which caused hard to track down crashes.
This is an addition to af04d0c37698.