Enabled users to define custom debug message listeners

I have made a trial piece of the framework that enables us to define our own debug message listeners as mentioned in #234. We can handle the debug messages in our individual preferred way by subclassing a new class named ```DebugListener```. The default behavior of ```debug()``` function is not changed.
How about it?