Adding redirect check and timeout

Possible for endless redirects, so added check. Also added timeout
option and custom error message on timeout.
Merge pull request #3 from russellbeattie/master

Redirect check and timeout fix (needs some tweaking, but thanks)