tests NEW xml printer defaults

Also some parser bugfixes included and
extensions refactoring to fix invalid
memory access of reading freed extension definitions.
diff --git a/src/printer.c b/src/printer.c
index 6efb076..6b03c01 100644
--- a/src/printer.c
+++ b/src/printer.c
@@ -64,14 +64,7 @@
   {"unique", "tag", 0},                         /**< LYEXT_SUBSTMT_UNIQUE */
 };
 
-/**
- * @brief Check whether a node value equals to its default one.
- *
- * @param[in] node Term node to test.
- * @return 0 if no,
- * @return non-zero if yes.
- */
-static int
+int
 ly_is_default(const struct lyd_node *node)
 {
     const struct lysc_node_leaf *leaf;