Added prevention for stack overflow, additional tests and base for a debugger class