Fixed test_for_connection

Fixed test_for_connection to return properly when no connection was
accepted
Bug fixes/signal handling

Handle SIGTERM in messengers to allow for cleanup on kill

Miscellaneous additions towards getting file transfer to work.  Works
in C code but errors occur farther up the stack
Cleanup for apparent final working copy

I think it all works?
Removed mocking
Merge branch 'dev'