test case on transfer-encoding

Rename existing directory 'base64' to 'encoding' and
add yet another test case.
error handling improvements

- do not throw, emit 'error' event instead,
- do not emit 'end' after 'error'.