add "-m" command switch: no threading

dispatch all requests in main thread. Also, add signal handler.