Move flush_fn setting so errors can be sent earlier.

(The flush_fn thing is still crap, and needs redoing, again.)
Reduce TTY spam.
Suppress SIGPIPE.

This code is believed to be BSD only.
Add little python test program for the HTTP server.

One bug found straight away!
Expose sha1 function.
Add yhs_get_content_details, a convenient(?) helper for PUT/POST.
Add a simple POST test.
Improve logging from tests.
Tweak TTY spam, comments, TODOs.