debug: generalized code improvements
A number of general code improvements to _debug_agent.js and
_debugger.js. Much of this involves modernizing the code to
make various bits more concise, eliminating the use of self
where possible, removing the creation of a few regex object
from a hot code path, and some other general refactoring.