improved error objects to include a toString() function, added regexp check for localhost(.localdomain)(:###) to go straight to http regardless of tls fallback.