Add Debug message event, and define function used by the debugger. This needs to be reimplemented using object concept. This commit is just a first draft