-Added preliminary url escaping fix
-Added check to see if run from CGI or Console