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.
Merge remote-tracking branch 'upstream/master' into entities
refactor on/off to enable/disable, to not clash with event naming later
introduce a notification function for entities
introduce handleCall function as an entry point for calls, and with that make act single-tasked by default