adding PORT environment variable support if none is specified, also ...

adding PORT environment variable support if none is specified, also
placing the automaic appendage of the port number, which may cause
problems with redirects (See  prvious commit)