Add OnAttachHook
Make cleanup work on CTRL-C
Add first integration test