Add utility function to remove trailing whitespace from file.