succesfully monkey patched urllib, it's still quite ugly... Somework left todo