Remove trailing whitespace

Sorry for the huge patch, but it changes no code logic and a verification should be trivial. 

Trailing whitespaces removed from all files in lib/