Added dist/ directory to .gitignore
Simplified the way signal handlers are set and unset