Merge pull request #2 from ChristophKnabe/master

User-Agent support
reformat code and move unchanging parts on top
Answering headers query.