Fixing status code, adding host option

* Redirect status code is now 302 (was 403)
* host can be set in options, otherwise hostname is used (no port number)
* simplified url generation
* updated tests
Merge pull request #3 from nfriedly/patch-2

Fixes for status code, host, tests