Trims trailing spaces and tabspaces after each line and trims leading and trailing newlines in a file