Adding redirect check and timeout

Possible for endless redirects, so added check. Also added timeout
option and custom error message on timeout.