Process daemon

I modify script/crawler to use Process.daemon instead of manually forking.
Additionally I make some refactoring and fixes.