Added flag for debug, renamed sortheaders to escapeheaders, added functions for dealing with list feeds