undef macros after use
introduce debug macros

This commit introduces log.h, which provides compile-time macros for
debugging (debug()) and error logging (error() and errorx()).

Compile with debug macros with `make debug`.