Added rudimentary signal handlers. Still needs some work.
Test fix.
Self-review