added #ifdef around headers to support test build. Modified debug messages.