Renderer refentity number usage cleanups from ioq3.
Few renderer patches merged from ioq3 (bmodels >= 1024 causing crash, etc)
Small cleanups in renderer (use of ARRAY_LEN and few other things)