Implemented command timeouts.
Flag cleanup.
Remove debugging Printlns.
Added lots of logging.