Use requests for all remaining urllib calls
Align exception logic correctly
Whitespace fixes for PEP8