Apply corrections from the "include what you use" tool

Generally cleanups of the includes. Making sure each file
can properly stand on its own and forward declares when possible.
Fix potential memory issue discovered by clang's analyzer
Fix issues found by cppcheck 1.65
Upgrade cppcheck and disable inconclusive checks