This patch cleans up the include guards, assisted by the tool/fix_include_ifndef script.
fix #710
fix #1197