Added debug.cpp and (debug.h) for commonly used debugging functions