Use single-quotes (consistency)
Import some __future__ features (Python {2,3} sanity)
Add comments to mark the major steps
Move some variables closer to where they are used
Use `with` to read the input file
Clean up code for requests
Un-with the GzipFile and comment on the 2.7+ req
Use boolean values for boolean variables
Simplify status check for 3XX responses
Qualify exception types
Rearrange imports to group Py2/3 imports together

(Also added a few more comments)
Merge pull request #7 from Zearin/develop

Various minor improvements (use `with` blocks, qualify exception types, add comments, etc.)