Move debug and logging support to a separate header