Changes for serving binary files

* changed render function (which assumed Strings) to more general write
function
* added default events for “error” and “listen”