Automated build release config, move debug macros

Moved debug macros to debug.h so they can be visible to any module that
includes it. Use CMAKE_BUILD_TYPE definitions in the automated build
to switch on the T__DEBUG flag for all source file compilations, and not
just for the test suite.

The test suite only builds in debug configurations.