debugger: add missing error checks to lua bindings.
debugger: cleanup lua script.
debugger: don't automatically connect.

Allow connection from the prompt, this is the first part to allowing us
to debug with the instruction set simulator.
debugger: add option parsing.

You can now use -x or --command to supply a command script that is run
by the debugger.
debugger: ensure output is flushed before and after script.
debugger/sim: allow the simulator to be terminated from the debugger.