Bring audit demo a little closer to real code.

Get rid of some #if 0 etc. by including more (modified) headers and supplying more stubs.
Improve runtime debugging control.

Previously, if the VERBOSE_DEBUG environment variable was set, we output every kind of debug string that we could think of.

Now when we produce debug output, we we use a name like "libtesla.state.update". That name is checked against a pattern in the TESLA_DEBUG environment variable, which can use wildcards (e.g. "libtesla.state.*") or can simply use a high-level name to refer to all its children (e.g. "libtesla" will include "libtesla.state", "libtesla.state.update", etc.).