sortviewentities from Doom3 BFG.
more cleanup.

Signed-off-by: revelator <ralphengels@gmail.com>