Implemented more of the Debugger functionality.

Implemented most of the debugger functionality. Changed where the debugger is invoked in the emulator.