Fix (almost) all warnings from clang 3.7, and use clang-modernize to further modernize the code. Fixes GAUDI-1118. See merge request !49