headers MAINTENANCE headers/include cleanup

- add missing extern "C" in some of the public headers for use in C++
- includes cleanup and fix ordering
diff --git a/src/tree_data.h b/src/tree_data.h
index ebb7620..34524dc 100644
--- a/src/tree_data.h
+++ b/src/tree_data.h
@@ -20,6 +20,10 @@
 
 #include "log.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct ly_ctx;
 struct ly_path;
 struct ly_set;
@@ -28,10 +32,6 @@
 struct lys_module;
 struct lysc_node;
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /**
  * @defgroup datatree Data Tree
  * @ingroup trees