Basic refactoring on debugger.

Help functions should live next to the code it calls so stuff is readable.  Also, now with functional parsing of commands and a bunch of cleanup.

There is one major hack left before the debugger can be pushed upstream.