Remove trailing whitespaces in .h, .cpp, .c and .lua files.
Merge pull request #237 from mounirlamouri/trailing_whitespaces

Remove trailing whitespaces in .h, .cpp, .c and .lua files.
Various cleanups in some C++ files.
Merge pull request #234 from mounirlamouri/cpp_cleanup
Add a script to check whether files in the working directory have trailing whitespaces.
Add a rule in Travis to check for trailing whitespaces.
Merge pull request #238 from mounirlamouri/travis_trailing