schemas FEATURE add schema getters from the context

Also check for the duplicities in the context when parsing a new schema.
diff --git a/src/tree_schema_helpers.c b/src/tree_schema_helpers.c
index 0d0620c..b95505a 100644
--- a/src/tree_schema_helpers.c
+++ b/src/tree_schema_helpers.c
@@ -92,7 +92,7 @@
     struct lysp_revision rev;
 
     for (i = 1, r = 0; revs && i < LY_ARRAY_SIZE(revs); i++) {
-        if (strcmp(revs[i].rev, revs[r].rev) > 0) {
+        if (strcmp(revs[i].date, revs[r].date) > 0) {
             r = i;
         }
     }