Cleanup pass 1

First pass of code cleanup to switch to urllib2