Add better debugging system

The debug system now uses the macro DBGPRINT, which is used the
same way as the standard printf() function. In addition the format
and other arguments given to the macro, the output  also contains
the file name, line number and the name of the function from which
the debugger was "called".