Modified version of debug library written by Fred Fish. Add some more features.