Altered how main process deals with kill thread.
Added structure to make a (cleaner) kill from the killserver thread.