Convert tabs to spaces and remove trailing whitespace