A couple of improvements and fixes:

- added --output,
- failed http requests are retried,
- status messages are written to stderr,
- Python 3 compatibility,
- fixed User-Agent header.