Part of symal was still written in K&R C (though with an anachronistic C99
version comment!). Updating it to ANSI C, adding const in many places for
clarity. Reordering functions to eliminate forward declarations.
Moving definition of Cmd_T into cmd.c, since it's local to that file.
Adding some wrappers to reduce the casts around Cmd_T.p. Narrowing the
scope of some variables.
Also updating the C++: use anonymous namespace for "static" definitions,
use enums and constants instead of preprocessor macros, use false/true as
boolean constants, throw exceptions instead of print-and-exit, avoid use of
"final" as an identifier since it's now a reserved word.