Fix string-quoting checks. Was breaking team joining etc.

Unfortunately, our code has a mix of (source, dest[, length]) and (dest[,
length], source) in function prototypes. We need to fix this, or this kind
of problem is likely to occur again. My preference is for the latter, giving
consistency with the likes of the standard C library: least surprise and all
that.
Add two missing buffer validation checks for string quoting.
Add VisTest functions to check if a 3D-point is visible in the current view
and use it to implement light flare entities.

The old trace-based code used the bounding box instead of the actual model
to cull flares.
Merge branch 'master' into resources