Added proxy options and extracted SSL stuff into it's own class.