Initial pass through CPPCheck

Encouragingly not too many changes to be made. Locally built CPPCheck
with QT GUI. Will look at adding to Travis/AppVeyor build at some point.