Moved debug functions to a separate core class
Todo comments added