ndomod: Refactor callbacks and data serialization.

Continue refactoring away the memory management overhead of escaping
to temporarily allocated buffers, and the code to manage that. A few
macros implementing common patterns further reduce redundant code.
ndomod: Refactor ndomod_write_object_config().

Continue refactoring away the memory management overhead of escaping to
temporarily allocated buffers, and the code to manage that. Combine
common #ifdef blocks and keep variables as local to their scope as
possible to reduce the number and length of code paths.
ndomod: Remove resource file dump stub functions.
ndomod: Cleanup config file and runtime var dumping.

Replace our last direct uses of asprintf() in ndomod with ndo_dbuf
equivalents which check for failed allocation.
ndo_dbuf_printf: Make NULL buf case explicit and clearer.
ndomod: Only nebmodule_(de)init() need external linkage.

All other ndomod_* functions in ndomod.[hc] can/should have internal
linkage (static). Leave the declatations in ndomod.h since only
nodmod.c includes it.

Refactor some comments, spacing/indentation, and overly verbose
functions. Add conditionally compiled opbject dump timing.
ndomod: Pad usecs to six digits when printing timevals.
ndomod: ARRAY_SIZE not sizeof for element count.
ndomod_broker_comment_data: Serialize comment_data.
ndomod_broker_adaptive_program_data: Don't shadow globals.

We should pass the extern global_{host|service}_event_handler
variables, rather than null-initialized locals of the same names.
ndomod: Cleanup sink related functions.

Remove some unused/unneeded code; and cleanup formatting and comments.
Touch up some minor literal value and defined constant usage all
around.
Merge branch 'ndomod-refactor'