Move debug() decorator out of gruntz.py (issue 2163)
Move maketree() and tree() functions out of the module namespace
Rename global variables for debug_decorator()
Adopt docstrings for debug_decorator()