Simplified signal handler
Multithread support added

Also created watcher and syncer threads.