Factor out httplib, replace with urllib