Add stream support

Fix cUrl headers
Reduce code dupplication
Add custom exceptions
Merge pull request #10 from widop/f-streams

Improvements