Added support for redirection in downloading and changed the user agent so that downloads will work.