Merge pull request #26 from akkie/master

Some code simplifications
Add Content-Length header (#20)