Make newline removal more robust, to handle Twitter's pushstate behavior