parser xml CHANGE non-xml specific functions made separate

So that they can be used in other parsers and
even API functions. Some general refactoring included.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 87910be..1e87269 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -212,6 +212,7 @@
     src/tree_data_helpers.c
     src/tree_data_hash.c
     src/parser_xml.c
+    src/parser_json.c
     src/printer_data.c
     src/printer_xml.c
     src/printer_json.c
@@ -272,7 +273,7 @@
 
     #link dl
     target_link_libraries(yang ${CMAKE_DL_LIBS})
-    
+
     set_target_properties(yangobj PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
 endif(ENABLE_STATIC)