Code cleaning

More PEP8
Replace urllib2 by requests
Merge pull request #1 from mekza/refactoring

Actually use data only for local node
Replace urllib2 by requests
Code cleaning
More PEP8