Changes for serving binary files

Please find changes in HttpServer and HttpCommon for serving binary fields while preserving existing behavior.

* changed render function (which assumed Strings) to more general write
function
* added default events for “error” and “listen”