Added a debug() method to logger and an enableDebug argument to the constructor.