Partially switched to multithreaded control.

StopableThread is basically what it sounds like -- a thread with a stop
method. It also has an thread-safe object that it uses to pass
information to other threads.