Add signal handler so you can ctrl+c
Add close implementation